package com.example.demo.config;

public class DataSourceManager {
    private static ThreadLocal<DataSourceType> dsHolder = new ThreadLocal<>();
    public static void setMaster(){ dsHolder.set(DataSourceType.MASTER); }
    public static void setSlave(){
        dsHolder.set(DataSourceType.SLAVE);
    }
    public static void reset(){
        dsHolder.remove();
    }
    public static DataSourceType getType(){
        return dsHolder.get();
    }
}
